home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 7895 < prev    next >
Encoding:
Text File  |  1996-08-05  |  1.4 KB  |  70 lines

  1. Newsgroups: comp.lang.c++
  2. Path: genesis.ilinkgn.net!not-for-mail
  3. From: johno@ilinkgn.net (john)
  4. Subject: Help I'm stuck! Can anyone help with a printer driver in C++ printcom.cpp (1/1)
  5. Message-ID: <2f7cc$10f20.41@genesis.ilinkgn.net>
  6. Date: Thu, 15 Feb 1996 21:15:32 GMT
  7. Organization: ilink global networks
  8. X-Newsreader: WinVN 0.99.7
  9. MIME-Version: 1.0
  10. Content-Type: Text/Plain; charset=US-ASCII
  11.  
  12. I am trying to write a C++ program using classes that has inline 
  13. functions to pass controll codes to a printer and resets the printer 
  14. after each one.  Any suggestions on what I am doing wrong??  If you can 
  15. fix it that would be much better!!
  16.  
  17. Thanks 
  18. C++ Novice
  19.  
  20. #include <iostream.h>
  21. #include <iomanip.h>
  22. #include <fstream.h>
  23.  
  24.  
  25.  
  26.  class Printer{
  27.  
  28.     ofstream prt;
  29.  
  30.     public:
  31.     Printer()
  32.  
  33.  
  34.      prt open ("prn");  // <<<--- KEEP GETTING
  35.              // "DECLARATION TERMINATED INCORRECTLY ERRORS
  36.  
  37.         
  38.     void bold() {prt << "\x1B\x28\x73\x33\x42";}
  39.     void score() {prt << "\x1B\x26\x64\x44";}
  40.     void clmarg() {prt << "\x1B\x39";}
  41.     void lscape() {prt << "\x1B\x26\x6C\x31\x4F";}
  42.     void portrt() {prt << "\x1B\x26\x6C\x30\x4F";}
  43.     void italic() {prt << "\x1B\x28\x73\x31\x53";}
  44.     void uprite() {prt << "\x1B\x28\x73\x30\x53";}
  45.  
  46. };
  47. {        
  48.  
  49.     ~Printer();
  50.     
  51.      void(){prt << "\x1B\x45";}
  52.      reset;
  53.      
  54.      prt close ("prn"); // <<<--- KEEP GETTING
  55.              // "DECLARATION TERMINATED INCORRECTLY ERRORS
  56.      
  57. }
  58. print line (char s [])
  59.  void page(){prt << '\f';}
  60.   
  61.  void main ()
  62.  
  63.  {
  64.   
  65.  }
  66.  
  67.  
  68.